<template>
  <div class="item">
    <div class="main">
      <div class="left">{{ item.year }}</div>
      <div class="center">
        <div
          class="jindu"
          :style="{
            width: Math.ceil(Math.abs(item.salary / tosalary) * 100) + '%'
          }"
        >
          $ {{ item.sample }}
        </div>
      </div>
      <div class="right">
        <i
          style="color:green"
          class="iconfont iconicon_shangsheng"
          v-if="item.sample - tosalary < 0"
        ></i>
        <i style="color:red" class="iconfont iconicon_xiajiang" v-else></i>

        {{ Math.abs(item.percent) + '%' }}
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: '',
  props: ['item', 'tosalary', 'data'],
  data () {
    return {}
  },
  methods: {},
  components: {}
}
</script>

<style lang="less" scoped>
.item {
  .main {
    display: flex;
    margin: 20px 0;
    .left {
      font-size: 14px;
      font-weight: 400;
      text-align: center;
      color: #545671;
      line-height: 20px;
    }
    .center {
      flex: 1;
      height: 15px;
      opacity: 1;
      background: #ebdfdf;
      border-radius: 4px;
      margin: 0 10px;
      .jindu {
        font-size: 10px;
        text-align: right;
        color: #ffffff;
        line-height: 17px;

        height: 100%;
        background-color: #fe6d67;
        border-radius: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    .right {
      width: 60px;
      font-size: 14px;
      font-weight: 400;
      text-align: left;
      color: #5b5d75;
      line-height: 20px;
    }
  }
}
</style>
